#ifndef PLURKCLIENT_H
#define PLURKCLIENT_H

#include <QWidget>
#include "qmlapplicationviewer.h"
#include "plurkapi.h"
#include "plurkauthview.h"
#include "plurksettings.h"

class PlurkClient : public QmlApplicationViewer
{
  Q_OBJECT
public:
  explicit PlurkClient(QWidget *parent = 0);
  void updateAppKey();
  void initRequest();

signals:
  void oauthKeys(const QString &appKey, const QString &appSecret);

public slots:
  void openAuthUrl(const QUrl &url);
  void authDone(bool success, const QString &verifier);
  void finishOAuth();
  void plurkRequestError();
//  void appNetworkError();

private:
  PlurkAPI      plurkAPI;
  PlurkAuthView authView;
  PlurkSettings *settings;
  bool          plurkInitDone;
};

#endif // PLURKCLIENT_H
